//验证工具类
const lodash = require('lodash');
const node_uuid = require('node-uuid');
const validator = require('./validator');
const uuid = {
    //验证必填项
    async v1(num) {
        if (validator.isEmpty(num)) {
            //返回一个
            let uid = await node_uuid.v1()
            return uid;
        } else {
            //返回一个uid数组
            let uids = [];
            for (var i = 0; i < num; i++) {
                uids.push(await node_uuid.v1());
            }
            return uids;
        }

    }
}

module.exports = uuid;